package cc.atliberty.structural.adapter.ex3;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * @Author 元宵
 * @url www.atliberty.cc
 * @Date 2023-10-31 07:57
 * @description:
 */
public class Enuterator implements Iterator {
    
    Enumeration enum1;
    
    public Enuterator(Enumeration enum1) {
        this.enum1 = enum1;
    }
    @Override
    public boolean hasNext() {
        return enum1.hasMoreElements();
    }

    @Override
    public Object next() {
        return enum1.nextElement();
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException();
    }
}
